import logging

import pytest

from resource.pom.settings import Settings


class Test:
    app = Settings

    @pytest.mark.parametrize('setup_teardown', [app.bundle_name], indirect=True)
    def test(self, setup_teardown, device):
        logging.info('步骤1.点击设置应用')
        device.start_ability(self.app.bundle_name, self.app.ability_name)
        logging.info('预期结果1.进入设置界面')
        device.assert_current_window(self.app.window_name)

        logging.info('步骤2.点击存储')
        device.click(*self.app.storage_item)
        logging.info('预期结果2.可以查看到已用空间和可用空间')
        device.refresh_layout()
        device.assert_text_exist('存储')
        device.assert_type_exist('Progress')
        device.assert_text_exist('已用空间')
        device.assert_text_exist('可用空间')
